<?php

	// +----------------------------------------------------------------------
	// | Pivot
	// +----------------------------------------------------------------------
	// | Copyright (c) 2015-2024 http://www.yicmf.com, All rights reserved.
	// +----------------------------------------------------------------------
	// | Author: 微尘 <yicmf@qq.com>
	// +----------------------------------------------------------------------

	namespace app\common\model;

	use think\facade\Db;
	use think\Model;
	use think\model\Pivot as PivotThink;

	class Pivot extends PivotThink
	{

		protected $autoWriteTimestamp = true;

		/**
		 * 架构函数
		 * @access public
		 * @param array|object $data 数据
		 * @param Model $parent 上级模型
		 * @param string $table 中间数据表名
		 */
		public function __construct($data = [], Model $parent = null, $table = '')
		{
			parent::__construct($data, $parent, $table);
			if (true === $this->autoWriteTimestamp) {
				$config = Db::getConfig();
				// 自动写入时间戳
				$this->autoWriteTimestamp = $config['auto_timestamp'];
			}

		}

	}
